﻿@using KDS.Mes.Web.Navigation
@using Abp.Web.Mvc.Extensions
@using KDS.Mes.Authorization
@using Abp.Application.Services.Dto
@using Abp.Extensions
@using KDS.Mes.Web.Models.Common.Modals
@using KDS.Mes.Web.Models.Plans
@using KDS.Mes.Mes.Plans

@model Tuple<PlansViewModel, CreateOrEditPlanModalViewModel>
@*@model PlansViewModel*@
@{
    ViewBag.ActiveMenu = PageNames.App.Common.Plans;
}

@section Styles{

    @*<link href="~/libs/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />*@
    <link href="~/Content/datepicker/datepicker3.css" rel="stylesheet" />
}

@* 注入所需JS *@
@section Scripts
{
    <script src="~/Content/datepicker/bootstrap-datepicker.js"></script>
    <script src="~/Content/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
    <script src="~/Content/layer/layer.js"></script>
    @Html.IncludeScript("~/Views/Plans/_CreateOrEditPlanModal.js")
    @Html.IncludeScript("~/Views/Plans/Index.js")
}
@*<div class="col-md-12">*@
<div class="box box-info collapsed-box">
    <div class="box-header with-border">
        <h3 class="box-title">@L("Query")</h3>
        <div class="box-tools pull-right">
            <button id="btn-query" type="button" class="btn btn-xs">
                <i class="fa fa-search">@L("Query")</i>
            </button>
            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                <i class="fa fa-plus"></i>
            </button>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="box-body">
            <div class="form-group">
                <label for="CartypeId" class="col-sm-1 control-label">@L("LineId")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("lineId", Model.Item1.Lines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   data_live_search = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "lineId"
               })
                </div>
                <label for="StyleId" class="col-sm-1 control-label">@L("PlanModeId")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("planModeId", Model.Item1.PlanModes.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   data_live_search = "true",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "planModeId"
               })
                </div>
                <label for="PlanDate" class="col-sm-1 control-label">@L("PlanDate")</label>
                <div class="col-sm-2">
                    <div class="input-group  date form_datetime">
                        <input id="PlanDate" type="text" name="PlanDate" readonly class="form-control">
                        <span class="input-group-btn">
                            <button class="btn default date-set" type="button">
                                <i class="fa fa-calendar"></i>
                            </button>
                        </span>
                    </div>
                </div>
                <label class="col-sm-1 control-label">@L("SeatPositionId")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("seatPositionId", Model.Item1.SeatPositions.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "seatPositionId"
                       ,
                   data_actions_box = "true"
                       ,
                   @multiple = "multiple"
               })
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">@L("IsOnline01")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline01", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline01"
               })
                </div>
                <label class="col-sm-1 control-label">@L("IsOnline02")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline02", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline02"
               })
                </div>
                <label class="col-sm-1 control-label">@L("IsOnline03")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline03", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline03"
               })
                </div>
                <label class="col-sm-1 control-label">@L("IsOnline04")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline04", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline04"
               })
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">@L("IsOnline05")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline05", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline05"
               })
                </div>

                <label class="col-sm-1 control-label">@L("IsOnline06")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline06", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline06"
               })
                </div>
                <label class="col-sm-1 control-label">@L("IsOnline07")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline07", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline07"
               })
                </div>
                <label class="col-sm-1 control-label">@L("IsOnline08")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline08", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline08"
               })
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">@L("IsOnline09")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline09", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline09"
               })
                </div>

                <label class="col-sm-1 control-label">@L("IsOnline10")</label>
                <div class="col-sm-2">
                    @Html.DropDownList("isOnline10", Model.Item1.IsOnlines.Select(a => a.ToSelectListItem()), new
               {
                   @class = "form-control selectpicker",
                   actionsBox = "true",
                   data_none_selected_text = L("PlaaseSelect"),
                   id = "isOnline10"
               })
                </div>

            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-md-9">
        <!-- MAP & BOX PANE -->
        <div class="box box-success">
            @*<div class="box-header with-border">
                    <h3 class="box-title">Visitors Report</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                        <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                    </div>
                </div>*@
            <!-- /.box-header -->
            <div class="box-body no-padding">
                <!-- bootstrap-tablel指定的工具栏 -->
                <div id="toolbar" class="btn-group">
                    @*@if (IsGranted(AppPermissions.Pages_Plan_Plans_Create))
                    {
                        <button id="btn-add" type="button" class="btn btn-primary">
                            <span class="fa fa-plus" aria-hidden="true"></span> @L("Add")
                        </button>
                    }*@
                    @if (IsGranted(AppPermissions.Pages_Plan_Plans_Edit))
                    {
                        <button id="btn-edit" type="button" class="btn btn-success">
                            <span class="fa fa-pencil" aria-hidden="true"></span> @L("Edit")
                        </button>
                    }
                    @if (IsGranted(AppPermissions.Pages_Plan_Plans_Delete))
                    {
                        <button id="btn-delete" type="button" class="btn btn-danger">
                            <span class="fa fa-remove" aria-hidden="true"></span> @L("Delete")
                        </button>
                    }
                    <button id="btn-export" type="button" class="btn btn-info">
                        <span class="glyphicon glyphicon-export" aria-hidden="true"></span> @L("Export")
                    </button>
                </div>
                <!--bootstrap-table表体-->
                <table id="tb"></table>
            </div>
            <!-- /.box-body -->
        </div>

    </div>

    <div class="col-md-3">

        <div class="box box-default">
            <div class="box-header with-border">
                <h3 class="box-title">@L("Add")</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse">
                        <i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
                <form id="planInformationsForm" role="form" novalidate class="form-validation">
                    <input type="hidden" name="Id" value="@Model.Item2.Plan.Id" />
                    <div>
                        <div class="form-group ">
                            <label for="lineIdEdit">@L("LineId")</label>
                            @Html.DropDownList("LineId", Model.Item2.Lines.Select(a => a.ToSelectListItem()), new
                       {
                           @class = "form-control selectpicker",
                           data_live_search = "true",
                           title = L("PlaaseSelect"),
                           id = "lineIdEdit"
                       })
                        </div>

                        <div class="form-group ">
                            <label for="alcCodeIdEdit">@L("AlcCodeId")</label>
                            @Html.DropDownList("AlcCodeId", Model.Item2.AlcCodes.Select(a => a.ToSelectListItem()), new
                       {
                           @class = "form-control selectpicker",
                           data_live_search = "true",
                           title = L("PlaaseSelect"),
                           id = "alcCodeIdEdit"
                       })
                        </div>

                        <div class="form-group ">
                            <label for="planModeIdEdit">@L("PlanModeId")</label>
                            @Html.DropDownList("PlanModeId", Model.Item2.PlanModes.Select(a => a.ToSelectListItem()), new
                       {
                           @class = "form-control selectpicker",
                           data_live_search = "true",
                           id = "planModeIdEdit"
                       })
                        </div>

                        <div class="form-group ">
                            <label>@L("Priority")   <span class="required"> * </span>	 	</label>
                            <input class="maxlength-handler form-control @(Model.Item2.Plan.Priority.ToString().IsNullOrEmpty() ? "" : " edited")" type="text" name="Priority" value="@Model.Item2.Plan.Priority" required />
                        </div>
                       
                        <div class="form-group ">
                            <label>@L("AfterSalePart")   <span class="required"> * </span>	 	</label>
                            @Html.DropDownList("AfterSalePart", Model.Item1.AfterSalePart.Select(a => a.ToSelectListItem()), new
                       {
                           @class = "form-control selectpicker",
                           actionsBox = "true",
                           data_none_selected_text = L("PlaaseSelect"),
                           id = "AfterSalePart"
                       })
                        </div>
                        <div class="form-group ">
                            <label>@L("Remark") </label>
                            <input class="maxlength-handler form-control @(Model.Item2.Plan.Remarks)" type="text" name="Remarks" value="@Model.Item2.Plan.Remarks"  />
                        </div>
                 

                        <div class="form-group ">
                            <label>@L("PlanQty")   <span class="required"> * </span>	 	</label>
                            <input class="maxlength-handler form-control @(Model.Item2.Plan.PlanQty.ToString().IsNullOrEmpty() ? "" : " edited")" type="text" name="PlanQty" value="@Model.Item2.Plan.PlanQty" required />
                        </div>

                        <div class="form-group ">
                            <label>@L("PlanDate"):    <span class="required"> * </span> </label>
                            <div class="input-group  date form_datetime">
                                <input type="text" name="PlanDate" value="@Model.Item2.Plan.PlanDate" readonly class="form-control">
                                <span class="input-group-btn">
                                    <button class="btn default date-set" type="button">
                                        <i class="fa fa-calendar"></i>
                                    </button>
                                </span>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="pull-right">
                    @if (IsGranted(AppPermissions.Pages_Plan_Plans_Create))
                    {
                        <button type="button" id="btn-save" class="btn btn-info save-button">
                            <i class="fa fa-save"></i> <span>@L("Add")</span>
                        </button>
                    }
                </div>
            </div>
        </div>
    </div>
</div>


@*<div class="box">
        <div class="box-body">
            <!-- bootstrap-tablel指定的工具栏 -->
            <div id="toolbar" class="btn-group">
                @if (IsGranted(AppPermissions.Pages_Plan_Plans_Create))
                {
                    <button id="btn-add" type="button" class="btn btn-primary">
                        <span class="fa fa-plus" aria-hidden="true"></span> @L("Add")
                    </button>
                }
                @if (IsGranted(AppPermissions.Pages_Plan_Plans_Edit))
                {
                    <button id="btn-edit" type="button" class="btn btn-success">
                        <span class="fa fa-pencil" aria-hidden="true"></span> @L("Edit")
                    </button>
                }
                @if (IsGranted(AppPermissions.Pages_Plan_Plans_Delete))
                {
                    <button id="btn-delete" type="button" class="btn btn-danger">
                        <span class="fa fa-remove" aria-hidden="true"></span> @L("Delete")
                    </button>
                }
            </div>
            <!--bootstrap-table表体-->
            <table id="tb"></table>
        </div>
    </div>*@
@*</div>*@
